Skip to content

Conversation

maurovanetti
Copy link

What kind of change does this PR introduce?

It allows for prefilled values for email and/or password in SupaEmailAuth.

What is the current behavior?

Currently, this value can only be inserted manually by the user.

What is the new behavior?

Unchanged if prefilledEmail and prefilledPassword are not specified in the widget's constructor.
If any of these values is set, the corresponding TextEditingController will be initialized with it.

maurovanetti and others added 8 commits June 19, 2025 11:27
Co-authored-by: maurovanetti <[email protected]>
Co-authored-by: maurovanetti <[email protected]>
- Extract _signInWithMagicLink() method in SupaMagicAuth
- Extract _submitForm() method in SupaPhoneAuth
- Extract _updatePassword() method in SupaResetPassword
- Fix use_build_context_synchronously warnings by properly checking context.mounted
- Fix sort_child_properties_last warnings by placing child parameter last
- Reduces code duplication and improves maintainability

Co-authored-by: maurovanetti <[email protected]>
…nt-auto-submit

Add enableAutomaticFormSubmission flag to prevent automatic form submission on Enter key
@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 15:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for prefilled email and password values in the SupaEmailAuth component, along with comprehensive improvements to form submission behavior across all authentication components.

  • Adds prefilledEmail and prefilledPassword parameters to SupaEmailAuth for prepopulating form fields
  • Introduces enableAutomaticFormSubmission flag to control whether pressing Enter automatically submits forms
  • Updates dependencies and applies code formatting improvements across multiple components

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/src/components/supa_email_auth.dart Adds prefilled email/password support and enableAutomaticFormSubmission flag
example/lib/sign_in_prefilled.dart New example demonstrating prefilled values functionality
lib/src/components/supa_phone_auth.dart Adds enableAutomaticFormSubmission flag and refactors form submission logic
lib/src/components/supa_magic_auth.dart Adds enableAutomaticFormSubmission flag and refactors form submission logic
lib/src/components/supa_reset_password.dart Adds enableAutomaticFormSubmission flag and refactors form submission logic
pubspec.yaml Updates dependency versions (email_validator, sign_in_with_apple)
README.md Documents new form submission control behavior
CHANGELOG.md Documents the new enableAutomaticFormSubmission feature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -1,3 +1,7 @@
## Unreleased

- feat: Add `enableAutomaticFormSubmission` flag to prevent automatic form submission when pressing Enter on on-screen keyboard in all auth components (SupaEmailAuth, SupaPhoneAuth, SupaMagicAuth, SupaResetPassword)
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog entry is missing documentation of the main feature mentioned in the PR title - the addition of prefilledEmail and prefilledPassword parameters to SupaEmailAuth.

Suggested change
- feat: Add `enableAutomaticFormSubmission` flag to prevent automatic form submission when pressing Enter on on-screen keyboard in all auth components (SupaEmailAuth, SupaPhoneAuth, SupaMagicAuth, SupaResetPassword)
- feat: Add `enableAutomaticFormSubmission` flag to prevent automatic form submission when pressing Enter on on-screen keyboard in all auth components (SupaEmailAuth, SupaPhoneAuth, SupaMagicAuth, SupaResetPassword)
- feat: Add `prefilledEmail` and `prefilledPassword` parameters to `SupaEmailAuth` to allow pre-populating the email and password fields. This is useful for deep linking or autofill scenarios.
```dart
SupaEmailAuth(
prefilledEmail: '[email protected]',
prefilledPassword: 'password123',
// other parameters...
)

Copilot uses AI. Check for mistakes.

Comment on lines +101 to +106
if (mounted) {
setState(() {
_phone.text = '';
_password.text = '';
});
}
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearing form fields after successful submission in phone auth may not be the desired behavior. This differs from the email auth component which doesn't clear fields on success and could create inconsistent user experience.

Suggested change
if (mounted) {
setState(() {
_phone.text = '';
_password.text = '';
});
}
// Do not clear fields after submission to match email auth behavior.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant